#!/usr/bin/env node
const Koa = require('koa');
const app = new Koa();

app.use(async(ctx,next)=>{
 const start = Date.now();
  next();
  const end = Date.now();
  const cost = end-start;
  console.log(`${ctx.method} ${ctx.path} ${cost}ms`);

})
app.use((ctx,next)=>{
  ctx.body='hello world!';
});
app.listen(3000);
console.log('hello world');
